<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>考试试卷编辑</title>
</head>

<body>
<style>
	.line{
		margin:5px 20px;
	}
	.div{
		float:left;
		margin:0px 50px 0px 10px;
		font-size:13px;
	}
	.line .line1{
		margin-left:130px;
	}
</style>
<script type="text/javascript">
	$(function(){
		$(".sjlr_back").linkbutton({
			onClick:function(){
				$(".sjlr_back_").panel({
					href:"to_kssj"
					
				})
			}
		})
		
		$('#sjlr_insert_tiku').textbox({
			icons: [{
				iconCls:'icon-add',
				handler: function(e){
					$("#sjlr_insert_win").dialog("open");
					$("#hhy_sjlr_insert_tiku").datagrid({onDblClickRow:function(index,row){
						var kssj_quId = row.quId;
						var kssj_quName= row.quName;
						$("#sjlr_insert_tiku").textbox("setValue",kssj_quId);
						$("#quName1").textbox("setValue",kssj_quName);
						$("#sjlr_insert_win").dialog("close");

					}});

				}
			}]
		})
		
		$("#hhy_sjlr_insert_add").linkbutton({onClick:function(){
			if ($('#epId').textbox("getText")=='' || $('#classSjName').textbox("getText")=='' || $('#epTotal').textbox("getText")=='' || $('#epShichang').textbox("getText")==''|| $('#sjlr_insert_tiku').textbox("getText")=='') {   
				$.messager.confirm('提示','带*的为必填项',function(r){    
				}); 
			}else{
			$("#sjlr_insert_form").form({
				url:'kssj_update_sava',
				onSubmit:function(insert){
					insert["epId"] = $("#epId").textbox("getText");
					insert["classSjName"] = $("#classSjName").textbox("getText");
					insert["epTotal"] = $("#epTotal").textbox("getText");
					insert["epShichang"] = $("#epShichang").textbox("getText");
					insert["epGrade"] = $("#epGrade").val();
					insert["epWay"] = $("#epWay").val();
					insert["epState"] = $("#epState").val();
					insert["quId"] = $("#sjlr_insert_tiku").textbox("getText");
					insert["quName"] = $("#quName1").textbox("getText");
				},
				success:function(v){
					v = eval("("+v+")");
					if(v.success){
						$.messager.alert('恭喜', '添加成功');
						$(".sjlr_back_").panel({
							href:"to_kssj"
						})
					}else{
						$.messager.alert('错误', '对不起，操作失败，原因：'+v.message);
					}
				}
			}).submit();
			}
		}});
		
		
		$('#numberRadio').linkbutton({
			onClick:function(){
				$("#numberRadio1").dialog("open");
			}
		})
		
		
	});
	
	
	
</script>
<div class="easyui-panel sjlr_back_" data-options="fit:true,border:false">
	<a href="#" class="easyui-linkbutton sjlr_back"  data-options="iconCls:'icon-back',plain:true,text:'返回'"></a>
<!-- <a href="#" class="easyui-linkbutton"  data-options="iconCls:'icon-save',plain:true,text:'保存'"></a> -->
	<form id="sjlr_insert_form" method="post"></form>
		<div class="div">
			<table style="margin-top: 10px;valign: center; border: 1px;">
				<tr>
					<td>
						<div style="border-bottom:2px solid blue;width:400px;">试卷</div>
					</td>
					<td>
						<div style="border-bottom:2px solid blue;width:400px;">概要</div>
					</td>
				</tr>
				<tr>
					<td style="padding-right: 90px;padding-top: 5px;">
						<input class="easyui-textbox" id="epId" name="epId" data-options="label:'*编号',width:350,height:25,labelWidth:130,readonly:true,editable:false" value="${update_list.epId }"/>
					</td>
					<td style="padding-top: 5px;">
						<input class="easyui-textbox" name="quId" id="sjlr_insert_tiku" data-options="label:'*题库',width:250,height:25,labelWidth:120,editable:false" value="${update_list.quId }"/>
						<input class="easyui-textbox" name="quName" id="quName1" data-options="width:120,height:25,readonly:true,editable:false" value="${update_list.quName }"/>
					</td>
				</tr>
				<tr>
					<td style="padding-top: 10px;">
						<input class="easyui-textbox" id="classSjName" name="classSjName" data-options="label:'*名称',width:350,height:25,labelWidth:130" value="${update_list.classSjName }"/>
						
					</td>
					<td style="padding-top: 10px;">
						<select name="epGrade" id="epGrade" class="easyui-combobox" data-options="label:'等级',width:370,height:25,panelHeight:'auto',labelWidth:120,editable:false">
						<option value="高级">高级</option>
						<option value="中级">中级</option>
						<option value="低级">低级</option>
						</select>
					</td>
				</tr>
				<tr>
					<td style="padding-top: 10px;">
						<input class="easyui-textbox" id="epTotal" name="epTotal" data-options="label:'*总分',width:350,height:25,labelWidth:130" value="${update_list.epTotal }"/>
					</td>
					<td style="padding-top: 10px;">
						<select name="epWay" id="epWay" class="easyui-combobox" data-options="label:'考试方式',width:370,height:25,panelHeight:'auto',labelWidth:120,editable:false">
						<option value="未开考">面试</option>
						<option value="笔试">笔试</option>
						<option value="机试">机试</option>
						</select>
					</td>
				</tr>
				<tr>
					<td style="padding-top: 10px;">
						<input class="easyui-textbox" id="epShichang" name="epShichang" data-options="label:'*时长',width:350,height:25,labelWidth:130" value="${update_list.epShichang }"/>
					</td>
					<td style="padding-top: 10px;">
						<select name="epState" id="epState" class="easyui-combobox" data-options="label:'考卷状态',width:370,height:25,panelHeight:'auto',labelWidth:120,editable:false">
							<option value="未开考">未开考</option>
							<option value="考试中">考试中</option>
							<option value="已交卷">已交卷</option>
							<option value="已评分">已评分</option>
							<option value="考试作废">考试作废</option>
						</select>
					</td>
				</tr>
				<tr>
					<td style="padding-top: 10px;">
						<input class="easyui-textbox" id="epShichang" name="epShichang" data-options="label:'*时长',width:350,height:25,labelWidth:130" value="${update_list.epShichang }"/>
					</td>
					<td style="padding-top: 10px;">
						
					</td>
				</tr>
			</table>
				
			</div>
			
			<div class="div" style="width:850px;height:150px;margin-top:10px;">
			<div  style="border-bottom:2px solid blue;width:850px;margin-bottom:5px;">题型
				<a href="#" class="easyui-linkbutton" id="numberRadio" style="margin-left:100px;"  data-options="plain:true,text:'添加'"></a>
				<a href="#" class="easyui-linkbutton"  data-options="plain:true,text:'题目录入'"></a>
				<a href="#" class="easyui-linkbutton"  data-options="plain:true,text:'删除'"></a>
			</div>
				<table id="sjlr_sousuo" class="easyui-datagrid" style="text-align:center;height:500px;" data-options="
					method:'post',
					fitColumns:true,
					fit:true,
					pagination:true,
					pageSize:1,
					pageList:[1,2,3,4,5],
					url:'to_wdkj_findAll',
					nowrap:false,
					autoRowHeight:true,
					rownumbers:true,
					singleSelect:true,
					striped:true
				">
					<thead>
						<tr>
							<th data-options="field:'epId',align:'center',width:'10'">序号</th>
							<th data-options="field:'classSjName',align:'center',width:'20'">题型</th>
							<th data-options="field:'epWay',align:'center',width:'10'">总量题</th>
							<th data-options="field:'epGrade',align:'center',width:'10'">抽题量</th>
							<th data-options="field:'epShichang',align:'center',width:'10'">分值</th>
							<th data-options="field:'epTotal',align:'center',width:'10'">合计</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
			</div><br/>
			<div class="div" style="width:200px;margin-top:30px;">
				<div class="">
					<a id="hhy_sjlr_insert_add" class="easyui-linkbutton" data-options="width:80,height:30,text:'添加'"></a>
				</div>
			</div>
			<div class="easyui-dialog" id="sjlr_insert_win" data-options="width:550,height:400,title:'清单查找-题库',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						$('#sjlr_close').form({
							onSubmit:function(){
								var row = $('#hhy_sjlr_insert_tiku').datagrid('getSelected');
									 	var kssj_quId = row.quId;
										var kssj_quName= row.quName;
										$('#sjlr_insert_tiku').textbox('setValue',kssj_quId);
										$('#quName1').textbox('setValue',kssj_quName);
								
							},success:function(v){
								$('#sjlr_insert_win').dialog('close');
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#sjlr_insert_tiku').dialog('close');
					}
				}]">
				<form action="" method="post" id="sjlr_close">
					<div class="line">
						<input class="easyui-textbox" name="quId" data-options="label:'题库编号',width:300,field:'quId'"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'模糊查询',width:100" style="float:right"/>
					</div>
					<div class="line">
						<input class="easyui-textbox" name="quName" data-options="label:'题库名称',width:300,field:'quName'"/>
						<a class="easyui-linkbutton" name="vague" data-options="text:'搜索',width:100" style="float:right"/>
					</div>
					<div class="line">
						<table id="hhy_sjlr_insert_tiku" style="width:100%;height:220px;" class="easyui-datagrid" data-options="
							url:'findAll_questionBank_page',
							method:'post',
							pagination:true,
							pageSize:1,
							pageList:[1,2,3,4,5],
							autoRowHeight:true,
							nowrap:false,
							rownumbers:true,
							singleSelect:true,
							striped:true
							
							">
							<thead>
							  <tr>
								<th data-options="align:'center',field:'quId',width:100">题库编号</th>
								<th data-options="align:'center',field:'quName',width:120">题库名称</th>
							  </tr>
							</thead>
							<tbody>
								
							</tbody>
						</table>
					</div>
				</form>
			</div>
			
			<div class="easyui-dialog" id="numberRadio1" data-options="width:350,height:220,title:'题型',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					id:'sure',
					iconCls:'icon-ok',
					handler:function(){
						$('kssj_sjlr_insert').form({
							url:'add_kssj_insert',
							onSubmit:function(insert){
								insert['examPaper.epId'] = $('#epId').textbox('getText');
								insert['examPaper.classSjName'] = $('#classSjName').textbox('getText');
								insert['examPaper.epTotal'] = $('#epTotal').textbox('getText');
								insert['examPaper.epShichang'] = $('#epShichang').textbox('getText');
								insert['examPaper.epGrade'] = $('#epGrade').val();
								insert['examPaper.epWay'] = $('#epWay').val();
							},success:function(v){
								$.messager.alert('提示','添加成功！');
								$('#numberRadio1').dialog('close');
									
							}
						}).submit();
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#numberRadio1').dialog('close');			
					}
				}]">
				<form action="" method="post" id="kssj_sjlr_insert">
					<div class="line">
						<input class="easyui-textbox" id="epId" data-options="label:'编号',width:250,height:25,labelWidth:100"/>
					</div>
					<div class="line">
						<select id="epGrade" class="easyui-combobox" data-options="label:'题型',width:250,height:25,panelHeight:'auto',labelWidth:100,editable:false">
							<option value="单选">单选</option>
							<option value="多选">多选</option>
							<option value="判断">判断</option>
							<option value="综合">综合</option>
						</select>
					</div>
					<div class="line">
						<input class="easyui-textbox" id="epTotal" value="0" data-options="label:'抽题量',width:250,height:25,labelWidth:100"/>
					</div>
					<div class="line">
						<input class="easyui-textbox" id="epShichang" value="0" data-options="label:'每题分值',width:250,height:25,labelWidth:100"/>
					</div>
					
				</div>
				</form>
			</div>
</div>
</body>
</html>